1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, and the like which are suitable for use in capturing an image of a human face.
2. Description of the Related Art
An imaging apparatus with an automatic exposure (AE) control function is widely used. When an object is photographed, an imaging apparatus with such AE control function can automatically set an appropriate aperture, shutter speed, and sensitivity based on brightness of the object. In the automatic exposure control, the imaging apparatus can use not only luminance information obtained by uniformly measuring luminance of the entire image frame but also regional light and dark contrast information obtained by dividing the image frame into a plurality of regions and measuring brightness of each of the regions. For example, when a photographer takes a photograph of a person standing with his or her back to the sun, that is, in a backlight scene, the imaging apparatus may produce an image in which the person is underexposed. In such a case, based on brightness information about each of the regions in the entire image frame, the imaging apparatus can determine whether photographing involves such a backlight scene and set an appropriate exposure level to brighten the person as a main object.
However, if the imaging apparatus adjusts exposure settings that are based on the aperture, shutter speed, and sensitivity to increase luminance of the person to an appropriate level, the background may be overexposed. To prevent this, the imaging apparatus obtains an appropriate background luminance level by adjusting the exposure settings that are based on the aperture, shutter speed, and sensitivity, and increases luminance of the underexposed person to an appropriate level by automatically firing a flash. Thus, the imaging apparatus can capture both the background and the main object with appropriate luminance. It is known that such use of flash firing is effective in capturing a scene with a significant contrast. Further, when the shutter speed is decreased in a low illumination scene, camera shake or object movement may be caused. As an effective measure against this, it is known that the imaging apparatus automatically fires a flash depending on the shutter speed.
Another situation in which automatic flash firing is desirable is when a human face partly includes dark shadows. For example, when the imaging apparatus photographs a person outdoors during the day, the sunlight illuminates the forehead or the nose bridge of the face from directly above or obliquely, which may result in formation of shadows around the eyes, lower cheeks, mouth, and the like. Also, when the imaging apparatus photographs a person indoors under a light source having some directional property in light distribution, such as a downlight or a spotlight, the face of the person may include shadows.
In automatic exposure control, even if the imaging apparatus adjusts the exposure settings that are based on the aperture, shutter, and sensitivity to set an appropriate brightness level for a human face, if a scene involves such a significant contrast, it is difficult for the imaging apparatus to generate a suitable image. Further, if the imaging apparatus averages brightness of the human face and calculates a luminance to automatically determine whether to fire a flash, bright regions and dark regions are canceled out. In this case, since the imaging apparatus recognizes that the face already has an appropriate brightness level, the imaging apparatus may not automatically fire a flash.
In view of the above points, Japanese Patent Application Laid-Open No. 2009-63674 discusses a technique, when the imaging apparatus detects a human face including a low luminance region, the imaging apparatus recognizes this region as a shadow and automatically fires a flash.
However, while this conventional technique discussed in Japanese Patent Application Laid-Open No. 2009-63674 achieves its intended object, the imaging apparatus is not sufficiently accurate in determining whether the low luminance region recognized as a shadow is actually a shadow formed by external light. Thus, the imaging apparatus often executes unnecessary flash firing. For example, the imaging apparatus may erroneously determine accessories such as sunglasses, glasses, or caps, mustache, hair, or dark skin of a person to be a shadow. As a result, the imaging apparatus may fail to execute suitable contrast adjustment.
This is a problem not only for imaging apparatuses that fire a flash. Image processing apparatuses have a similar problem. For example, when an image processing apparatus acquires an image and determines that an object in the image includes a shadow region, the image processing apparatus increases the luminance level of the shadow region in the image to set the contrast of the object in the image to an appropriate level. If the image processing apparatus erroneously determines accessories such as sunglasses, glasses, or caps, mustache, or hair to be a shadow, the image processing apparatus cannot appropriately adjust contrast of the object.